import { createRouter, createWebHistory } from 'vue-router'
import  HomeView from '@/views/home/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path:'/',
      redirect:'/home'
    },{
      path: '/home',
      component: HomeView,
      children:[{
        path:'/detail/:id',
        component:()=>import("@/views/detail/index.vue")
      }]
    },
    {
      path: '/login',
      component: ()=>import( "@/views/login/index.vue")
    }
  ],
})

export default router
